/*
function RefreshGuestbox(){
    $.ajax({
        url: "?Ajax=GuestBoxMessages",
        type: "GET",
        dataType: "html",
        beforeSend: function () {
			$("#GBRefresh").hide();
            $("#GBLoading").show();
        },
        success: function (data, textStatus, xhr) {
			setTimeout(function () {
				$("#GuestBoxContent").html(data);
				$("#GBLoading").hide();
				$("#GBRefresh").show();
			}, 300); // TODO: remove simulated latency
        },
        error: function (xhr, textStatus, errorThrown) {
            $("#GuestBoxContent").html(textStatus);
			$("#GBLoading").hide();
			$("#GBRefresh").show();
        }
    });
}

function SubmitGuestbox(){
	if( $("#GBMsg").val() == '' ) { return false; }
	$.ajax({
		url: '?Ajax=GuestBoxSubmit',
		type:'POST',
		data:$('#GBForm').serialize(),
		beforeSend: function() {
			$("#GBMsg").val('');
		},
		success: RefreshGuestbox,
	});
	return false;
}

$(document).ready(function(){
	
	// GuestBox auto refreshing
	$("#GBLoading").hide();
	new Spinner({
		lines: 15,
		length: 0,
		width: 3,
		radius: 4,
		color: '#79a800',
		speed: 2.2,
		trail: 50,
	}).spin(
		document.getElementById('GBLoading')
	);
	
	setInterval( RefreshGuestbox, 30000 );
	
	$("#GBRefresh").click( RefreshGuestbox );
	
});
*/

